package com.zr.service.impl;

import com.zr.dao.E_userDao;
import com.zr.dao.impl.E_userDaoImpl;
import com.zr.service.AddOneUserService;

public class AddOneUserServiceImpl implements AddOneUserService{
	private E_userDao userDao = new E_userDaoImpl();
	
	@Override
	public String getAddOneUserByUnameUpseRid(String uname, String upsw, int rid) {
		boolean b = userDao.selectUserNameByUname(uname);
		if(b){
			return "用户已经存在";
		}else{
			boolean b2 = userDao.addUser(uname, upsw, rid);
			if(b2){
				return "添加成功";
			}else{
				return "添加失败";
			}
		}
	}
	
}
